<% form_tag '/reports/show' do -%>
Type:<%= select_tag("report_template_id", 
              options_for_select(@report_templates.collect {|p| [ p.name, p.id.to_s ] },
              ( @report_template ? @report_template.id.to_s : nil))) %>
<%= observe_field :report_template_id, :url => { :action => :update_conditions },
      :update => :condition_fields,
      :with => 'report_template_id'
      %>
<%= submit_tag "Reset condition fields", :id => "reset_button" %>
<script type="text/javascript">
// <![CDATA[
// This is needed to hide reset_button when javascript is enabled
  document.getElementById("reset_button").style.display = 'none';
    
// ]]>
</script>
<div id="condition_fields">
<% if @report_template -%>
 <%= render :partial => 'conditions_fields' -%>
<% end -%>
</div>
<%= submit_tag "Make report" %>
<% end -%>
